home *** CD-ROM | disk | FTP | other *** search
- Path: news.halcyon.com!usenet
- From: normanb@halcyon.com (Norm Bryar)
- Newsgroups: comp.lang.c++
- Subject: Re: stream question
- Date: Sat, 20 Apr 1996 15:35:56 GMT
- Organization: Northwest Nexus Inc.
- Message-ID: <4lb07d$5m6@news.halcyon.com>
- References: <NEWTNews.829954661.22104.ger@kayak.fsl.wvnet.edu>
- NNTP-Posting-Host: blv-pm2-ip16.halcyon.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- George Racin <george@gypsy.fsl.wvnet.edu> wrote:
-
-
- >If name is equal to "Ben Eric Smith" and is on one line of an ASCII text file
- >and I have the following code, how do I get the entire line into name, rather
- >than just "Ben".
- >Thanks in advance.
-
- >{
- > char name[20];
-
- > ifstream inpstream(fileName);
- > inpstream >> name;
- >}
-
- >george@gypsy.fsl.wvnet.edu
-
- ifstream derives from istream. Use istream::getline().
- Good luck.
- --Norm
-
-